package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.NursingProjectPageQueryDto;
import com.zzyl.entity.NursingProject;
import com.zzyl.vo.NursingProjectVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface NursingProjectMapper {

    Page<NursingProjectVo> pageQuery(NursingProjectPageQueryDto dto);

    void insert(NursingProject nursingProject);

    @Select("select * from nursing_project where id = #{id}")
    NursingProject selectById(Long id);

    void updateById(NursingProject nursingProject);

    @Update("update nursing_project set status=#{status} where id=#{id}")
    void updateStatus(Long id, Integer status);

    @Delete("delete from nursing_project where id = #{id}")
    void deleteById(Long id);

    @Select("select * from nursing_project where status=1")
    List<NursingProject> getAll();

}